
package shining365.programmableweb.data.history;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.builder.JAXBEqualsBuilder;
import org.jvnet.jaxb2_commons.lang.builder.JAXBHashCodeBuilder;
import org.jvnet.jaxb2_commons.lang.builder.JAXBToStringBuilder;


/**
 * <p>Java class for anonymous complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;attribute name="url" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
 *       &lt;attribute name="centrality" use="required" type="{http://www.w3.org/2001/XMLSchema}double" />
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "api")
@Entity(name = "shining365.programmableweb.data.history.Api")
@Table(name = "API_0")
@Inheritance(strategy = InheritanceType.JOINED)
public class Api
    implements Equals, HashCode, ToString
{

    @XmlAttribute(required = true)
    @XmlSchemaType(name = "anySimpleType")
    protected String url;
    @XmlAttribute(required = true)
    protected double centrality;

    /**
     * Gets the value of the url property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    @Id
    @Column(name = "URL")
    public String getUrl() {
        return url;
    }

    /**
     * Sets the value of the url property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setUrl(String value) {
        this.url = value;
    }

    @Transient
    public boolean isSetUrl() {
        return (this.url!= null);
    }

    /**
     * Gets the value of the centrality property.
     * 
     */
    @Basic
    @Column(name = "CENTRALITY")
    public double getCentrality() {
        return centrality;
    }

    /**
     * Sets the value of the centrality property.
     * 
     */
    public void setCentrality(double value) {
        this.centrality = value;
    }

    @Transient
    public boolean isSetCentrality() {
        return true;
    }

    public void equals(Object object, EqualsBuilder equalsBuilder) {
        if (!(object instanceof Api)) {
            equalsBuilder.appendSuper(false);
            return ;
        }
        if (this == object) {
            return ;
        }
        final Api that = ((Api) object);
        equalsBuilder.append(this.getUrl(), that.getUrl());
        equalsBuilder.append(this.getCentrality(), that.getCentrality());
    }

    public boolean equals(Object object) {
        if (!(object instanceof Api)) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder();
        equals(object, equalsBuilder);
        return equalsBuilder.isEquals();
    }

    public void hashCode(HashCodeBuilder hashCodeBuilder) {
        hashCodeBuilder.append(this.getUrl());
        hashCodeBuilder.append(this.getCentrality());
    }

    public int hashCode() {
        final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder();
        hashCode(hashCodeBuilder);
        return hashCodeBuilder.toHashCode();
    }

    public void toString(ToStringBuilder toStringBuilder) {
        {
            String theUrl;
            theUrl = this.getUrl();
            toStringBuilder.append("url", theUrl);
        }
        {
            double theCentrality;
            theCentrality = this.getCentrality();
            toStringBuilder.append("centrality", theCentrality);
        }
    }

    public String toString() {
        final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this);
        toString(toStringBuilder);
        return toStringBuilder.toString();
    }

}
